import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["colorful", "flag", "children", "className"];
import React from 'react';
import { Icon } from 'antd';
import classNames from 'classnames';
import styles from "./index.less?modules";

var Trend = function Trend(_ref) {
  var _ref$colorful = _ref.colorful,
      colorful = _ref$colorful === void 0 ? true : _ref$colorful,
      flag = _ref.flag,
      children = _ref.children,
      className = _ref.className,
      rest = _objectWithoutProperties(_ref, _excluded);

  var classString = classNames(styles.trendItem, _defineProperty({}, styles.trendItemGrey, !colorful), className);
  return /*#__PURE__*/React.createElement("div", Object.assign({}, rest, {
    className: classString,
    title: typeof children === 'string' ? children : ''
  }), /*#__PURE__*/React.createElement("span", {
    className: styles.value
  }, children), flag && /*#__PURE__*/React.createElement("span", {
    className: styles[flag]
  }, /*#__PURE__*/React.createElement(Icon, {
    type: "caret-".concat(flag)
  })));
};

export default Trend;